<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title></title>
<#include "/jeecms_sys/head.html"/>
<script type="text/javascript">
function getTableForm() {
	return document.getElementById('tableForm');
}
function optRecycle() {
	if(Pn.checkedCount('ids')<=0) {
		alert("<@s.m 'error.checkRecord'/>");
		return;
	}
	var f = getTableForm();
	f.action="o_recycle.do";
	f.submit();
}
function optDelete() {
	if(Pn.checkedCount('ids')<=0) {
		alert("<@s.m 'error.checkRecord'/>");
		return;
	}
	if(!confirm("<@s.m 'global.confirm.delete'/>")) {
		return;
	}
	var f = getTableForm();
	f.action="o_delete.do";
	f.submit();
}
</script>
</head>
<body>
<div class="box-positon">
	<div class="rpos"><@s.m "global.position"/>: <@s.m "contentCycle.function"/> - <@s.m "global.list"/></div>
	<form class="ropt">
	</form>
	<div class="clear"></div>
</div>
<div class="body-box">
<form action="v_list.do" method="post" style="padding-top:5px;">
<div>
<@s.m "content.title"/>: <input type="text" name="queryTitle" value="${queryTitle!}" style="width:100px"/>
<@s.m "content.user"/>: <input type="text" name="queryInputUsername" value="${queryInputUsername!}" style="width:70px"/>
<@p.select name="queryOrderBy" value=queryOrderBy list={"0":"content.orderBy.0","1":"content.orderBy.1","2":"content.orderBy.2","3":"content.orderBy.3","4":"content.orderBy.4","5":"content.orderBy.5","6":"content.orderBy.6","7":"content.orderBy.7","8":"content.orderBy.8","9":"content.orderBy.9","10":"content.orderBy.10","11":"content.orderBy.11","12":"content.orderBy.12","13":"content.orderBy.13","14":"content.orderBy.14","15":"content.orderBy.15","16":"content.orderBy.16","17":"content.orderBy.17","18":"content.orderBy.18","19":"content.orderBy.19","20":"content.orderBy.20","21":"content.orderBy.21"}/>
<input type="hidden" name="cid" value="${cid!}"/>
<input class="query" type="submit" value="<@s.m "global.query"/>"/>
</div>
</form>
<form id="tableForm" method="post">
<input type="hidden" name="pageNo" value="${pageNo!}"/>
<input type="hidden" name="cid" value="${cid!}"/>
<#list .data_model?keys as pkey>
	<#if pkey?starts_with('query')><input type="hidden" name="${pkey}" value="${(.data_model[pkey])!?string}"/></#if><#t/>
</#list>

<@p.table value=pagination;content,i,has_next><#rt/>
	<@p.column title="<input type='checkbox' onclick='Pn.checkbox(\"ids\",this.checked)'/>" width="20">
		<input type='checkbox' name='ids' value='${content.id}'/><#t/>
	</@p.column><#t/>
	<@p.column title="ID">${content.id}</@p.column><#t/>
	<@p.column code="content.title">
		<#if content.topLevel gt 0><span style="color:red">[<@s.m "content.topLevel.short"/>${content.topLevel}]</span></#if>
		<#if content.recommend><span style="color:red">[<@s.m "content.recommend.short"/>]</span></#if>
		<strong>[${content.channel.name}]</strong>
		<a href="${(content.url)?replace('//','/')}" target="_blank"><@text_cut s=content.title?html len=25 append="..."/></a>
		<#if content.checkOption??>
		<br/><span style="color:red">${content.checkOption}</span>
		</#if>
	</@p.column><#t/>
	<@p.column code="content.type" align="center">${content.type.name}</@p.column><#t/>
	<@p.column code="content.user" align="center">${content.user.username}</@p.column><#t/>
	<@p.column code="content.views" align="right">${content.views}</@p.column><#t/>
	<#if queryOrderBy??>
		<#switch queryOrderBy>
		<#case 6>
			<@p.column code="content.viewsDay" align="right">${content.viewsDay}</@p.column><#t/>
			<#break>
		<#case 7>
			<@p.column code="content.viewsWeek" align="right">${content.contentCount.viewsWeek}</@p.column><#t/>
			<#break>
		<#case 8>
			<@p.column code="content.viewsMonth" align="right">${content.contentCount.viewsMonth}</@p.column><#t/>
			<#break>
		<#case 10>
			<@p.column code="content.commentsDay" align="right">${content.commentsDay}</@p.column><#t/>
			<#break>
		<#case 11>
			<@p.column code="content.commentsWeek" align="right">${content.contentCount.commentsWeek}</@p.column><#t/>
			<#break>
		<#case 12>
			<@p.column code="content.commentsMonth" align="right">${content.contentCount.commentsMonth}</@p.column><#t/>
			<#break>
		<#case 13>
			<@p.column code="content.comments" align="right">${content.contentCount.comments}</@p.column><#t/>
			<#break>			
		<#case 14>
			<@p.column code="content.downloadsDay" align="right">${content.downloadsDay}</@p.column><#t/>
			<#break>
		<#case 15>
			<@p.column code="content.downloadsWeek" align="right">${content.contentCount.downloadsWeek}</@p.column><#t/>
			<#break>
		<#case 16>
			<@p.column code="content.downloadsMonth" align="right">${content.contentCount.downloadsMonth}</@p.column><#t/>
			<#break>
		<#case 17>
			<@p.column code="content.downloads" align="right">${content.contentCount.downloads}</@p.column><#t/>
			<#break>			
		<#case 18>
			<@p.column code="content.upsDay" align="right">${content.upsDay}</@p.column><#t/>
			<#break>
		<#case 19>
			<@p.column code="content.upsWeek" align="right">${content.contentCount.upsWeek}</@p.column><#t/>
			<#break>
		<#case 20>
			<@p.column code="content.upsMonth" align="right">${content.contentCount.upsMonth}</@p.column><#t/>
			<#break>
		<#case 21>
			<@p.column code="content.ups" align="right">${content.contentCount.ups}</@p.column><#t/>
			<#break>
		<#default>
		</#switch>
	</#if>
	<@p.column code="content.releaseDate" align="center">${content.releaseDate?string('yyyy-MM-dd')}</@p.column><#t/>
	<@p.column code="content.status" align="center">
		<@s.m "content.status."+content.status/>
		<#if content.status==1> ${content.checkStep}<#if content.rejected> <span style="color:red"><@s.m "content.status.rejected"/></span></#if></#if>
	</@p.column><#t/>
	<@p.column code="global.operate" align="center">
		<#assign params>&cid=${cid!}&pageNo=${pageNo!}&queryTitle=${queryTitle!?url}&queryInputUsername=${queryInputUsername!?url}&queryOrderBy=${queryOrderBy!}</#assign>
		<a href="o_recycle.do?ids=${content.id}${params}" class="pn-opt"><@s.m "contentCycle.recycle"/></a> | <#rt/>
		<a href="o_delete.do?ids=${content.id}${params}" onclick="if(!confirm('<@s.m "global.confirm.delete"/>')) {return false;}" class="pn-opt"><@s.m "global.delete"/></a><#t/>
	</@p.column><#t/>
</@p.table>
<div style="margin-top:15px;">
	<input class="del-button" type="button" value="<@s.m "global.delete"/>" onclick="optDelete();"/>
	<input class="recycle" type="button" value="<@s.m "contentCycle.recycle"/>" onclick="optRecycle();"/>
</div>
</form>
</div>
<#include "/common/alert_message.html"/>
</body>
</html>